using System; using System.Collections; using System.Diagnostics; using System.Web.Script.Services; using System.Web.Services; using GBPVR.Public; using GBPVRSchedule; /// /// Summary description for Ajax_Calls /// /// namespace gbweb.classes { [ScriptService] public class Ajax_Calls : WebService { [WebMethod] public string GetServerTime() { return DateTime.Now.ToLongTimeString().Trim(); } [WebMethod] public string GetReminders() { Settings guideParams = Global.Settings; Schedule scheduleHelper = Global.Schedule; ArrayList reminders = scheduleHelper.GetReminderList(); string temptitle = string.Empty; string returnReminders = string.Empty; string onclick = string.Empty; string href = string.Empty; foreach (Programme reminder in reminders) { TimeSpan span = reminder.getStartTime() - DateTime.Now; int minutes = span.Minutes; if (span.Days > 0) { minutes = minutes + ((span.Days * 24) * 60); } if (span.Hours > 0) { minutes = minutes + (span.Hours * 60); } if ((minutes <= Convert.ToInt32(guideParams.reminder) && minutes > 0) || (minutes == 0 && span.Seconds < -30)) { href = "Details.aspx?id=" + reminder.getOID(); ScheduledRecording checkSchedule = scheduleHelper.GetScheduledRecordingByOID(reminder.getOID()); if ( checkSchedule != null) { href += "&rid=" + reminder.getOID(); } onclick = " onclick=\"EditPop5(this.href,'Add2');return false;\""; temptitle += "" + reminder.getStartTime().ToShortDateString() + " " + reminder.getStartTime().ToShortTimeString() + " " + reminder.getTitle(); temptitle = "" + temptitle + "
"; returnReminders += temptitle; temptitle = string.Empty; } } if (returnReminders != string.Empty) { reminders.Clear(); reminders.TrimToSize(); return returnReminders; } else { reminders.Clear(); reminders.TrimToSize(); return ""; } } [WebMethod] public string GetStreamerStatus() { string streamActive = ""; //Check processes running on the seerver. If VLC is running assuming streaming is active try { foreach (Process thisproc in Process.GetProcessesByName("vlc")) { streamActive = "true"; continue; } } catch (Exception Exc) { } return streamActive; } } }